import {colorRange, colors, legend, tooltip} from "@/package/widget/chart/01base/util";

const data = [
  {
    "data": {
      "output": 50,
      "kda": 65,
      "develop": 67,
      "warfare": 76,
      "survival": 54
    },
    "group": "张三"
  },
  {
    "data": {
      "output": 34,
      "kda": 77,
      "develop": 66,
      "warfare": 88,
      "survival": 44
    },
    "group": "李四"
  }
]

export default {
  name: '基础雷达图',
  icon: '/img/chart/radar.png',
  type: '雷达图',
  cptKey: 'radar01',
  width: 300,
  height: 300,
  dynamic: true,
  options: {
    cptDataForm: {
      dataText: JSON.stringify(data),
      dataSource: 1,
      pollTime: 0
    },
    attribute: {
      color: colors,
      colorRange,
      legend,
      tooltip: {
        ...tooltip,
        trigger: 'item'
      },
      radar: {
        radius: 65,
        startAngle: 90,
        center: ['50%', '60%'],
        nameGap: 15, // 指示器名称和指示器轴的距离
        splitNumber: 5, // 分割段数
        shape: 'polygon', // polygon、circle
        axisName: { // 指示器名称
          show: true,
          color: '#fff',
          formatter: '{value}',
          formatterFn: '',
          fontSize: 16,
          textShadowColor: '#00F7FF',
          textShadowBlur: 2,
          textShadowOffsetX: '',
          textShadowOffsetY: ''
        },
        axisLine: { // 坐标轴
          show: true,
          lineStyle: {
            color: '#07AAD5',
            width: 1,
            shadowColor: '',
            shadowBlur: '',
            shadowOffsetX: 0,
            shadowOffsetY: 0
          }
        },
        splitLine: { // 分割线
          show: true,
          lineStyle: {
            color: ['#07AAD5'],
            width: 1,
            shadowColor: '',
            shadowBlur: '',
            shadowOffsetX: 0,
            shadowOffsetY: 0
          }
        },
        splitArea: {
          show: true,
          areaStyle: {
            color: ['transparent'],
            shadowColor: '',
            shadowBlur: '',
            shadowOffsetX: 0,
            shadowOffsetY: 0
          }
        },
        indicator: [
          {id: 1, name: '输出', prop: 'output', max: 100},
          {id: 2, name: 'KDA', prop: 'kda', max: 100},
          {id: 3, name: '发育', prop: 'develop', max: 100},
          {id: 4, name: '团战', prop: 'warfare', max: 100},
          {id: 5, name: '生存', prop: 'survival', max: 100}
        ]
      },
      series: [
        {
          type: 'radar',
          symbol: 'circle', //
          symbolSize: 10, //
          itemStyle: {
            shadowBlur: 0,
            shadowColor: '',
            borderColor: '',
            borderWidth: 0
          },
          data: []
        }
      ]
    }
  }
}
